<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select($event)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref='multipleTable' :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.emwplist.main2_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('emwplistid')">
                <el-table-column show-overflow-tooltip :prop="'emwplistid'" :label="$t('entities.emwplist.main2_grid.columns.emwplistid')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.emwplistid')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.emwplistid}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemname')">
                <el-table-column show-overflow-tooltip :prop="'itemname'" :label="$t('entities.emwplist.main2_grid.columns.itemname')" :width="240"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.itemname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emitem' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emitem-tab-exp-view', height: 0,width: 0,title: $t('entities.emitem.views.tabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'emservices', parameterName: 'emservice' },
            ]
            ,parameters: [
            { pathName: 'emitems', parameterName: 'emitem' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}" valueitem="itemid">
                            <span>{{row.itemname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemcode')">
                <el-table-column show-overflow-tooltip :prop="'itemcode'" :label="$t('entities.emwplist.main2_grid.columns.itemcode')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.itemcode')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.itemcode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('asum')">
                <el-table-column show-overflow-tooltip :prop="'asum'" :label="$t('entities.emwplist.main2_grid.columns.asum')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.asum')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.asum"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wplistdp')">
                <el-table-column show-overflow-tooltip :prop="'wplistdp'" :label="$t('entities.emwplist.main2_grid.columns.wplistdp')" :width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.wplistdp')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.wplistdp}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemdesc')">
                <el-table-column show-overflow-tooltip :prop="'itemdesc'" :label="$t('entities.emwplist.main2_grid.columns.itemdesc')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.itemdesc')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.itemdesc}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wfstep')">
                <el-table-column show-overflow-tooltip :prop="'wfstep'" :label="$t('entities.emwplist.main2_grid.columns.wfstep')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.wfstep')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.wfstep" tag='EMWPLISTWFSTEP' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('aempname')">
                <el-table-column show-overflow-tooltip :prop="'aempname'" :label="$t('entities.emwplist.main2_grid.columns.aempname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.aempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.aempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('adate')">
                <el-table-column show-overflow-tooltip :prop="'adate'" :label="$t('entities.emwplist.main2_grid.columns.adate')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.adate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.adate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('lastdate')">
                <el-table-column show-overflow-tooltip :prop="'lastdate'" :label="$t('entities.emwplist.main2_grid.columns.lastdate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.lastdate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.lastdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('unitname')">
                <el-table-column show-overflow-tooltip :prop="'unitname'" :label="$t('entities.emwplist.main2_grid.columns.unitname')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.unitname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.unitname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wpliststate')">
                <el-table-column show-overflow-tooltip :prop="'wpliststate'" :label="$t('entities.emwplist.main2_grid.columns.wpliststate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.wpliststate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.wpliststate" tag='EMWPLISTSTATE' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('objname')">
                <el-table-column show-overflow-tooltip :prop="'objname'" :label="$t('entities.emwplist.main2_grid.columns.objname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.objname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.objname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('rempname')">
                <el-table-column show-overflow-tooltip :prop="'rempname'" :label="$t('entities.emwplist.main2_grid.columns.rempname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.rempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.rempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wplistcostname')">
                <el-table-column show-overflow-tooltip :prop="'wplistcostname'" :label="$t('entities.emwplist.main2_grid.columns.wplistcostname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.wplistcostname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.wplistcostname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('useto')">
                <el-table-column show-overflow-tooltip :prop="'useto'" :label="$t('entities.emwplist.main2_grid.columns.useto')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.useto')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.useto" tag='EMUSETO' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('equipname')">
                <el-table-column show-overflow-tooltip :prop="'equipname'" :label="$t('entities.emwplist.main2_grid.columns.equipname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.equipname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emequip' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emequip-tab-exp-view', height: 0,width: 0,title: $t('entities.emequip.views.tabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'pfteams', parameterName: 'pfteam' },
            ]
            ,parameters: [
            { pathName: 'emequips', parameterName: 'emequip' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}" valueitem="equipid">
                            <span>{{row.equipname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('deptname')">
                <el-table-column show-overflow-tooltip :prop="'deptname'" :label="$t('entities.emwplist.main2_grid.columns.deptname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.deptname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.deptname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('teamname')">
                <el-table-column show-overflow-tooltip :prop="'teamname'" :label="$t('entities.emwplist.main2_grid.columns.teamname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.teamname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='pfteam' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'pfteamedit-view', height: 0,width: 0,title: $t('entities.pfteam.views.editview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'pfteams', parameterName: 'pfteam' },
            { pathName: 'editview', parameterName: 'editview' }
            ]}" valueitem="teamid">
                            <span>{{row.teamname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('apprempname')">
                <el-table-column show-overflow-tooltip :prop="'apprempname'" :label="$t('entities.emwplist.main2_grid.columns.apprempname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.apprempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.apprempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('apprdate')">
                <el-table-column show-overflow-tooltip :prop="'apprdate'" :label="$t('entities.emwplist.main2_grid.columns.apprdate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.apprdate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.apprdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('hdate')">
                <el-table-column show-overflow-tooltip :prop="'hdate'" :label="$t('entities.emwplist.main2_grid.columns.hdate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.hdate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.hdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wplisttype')">
                <el-table-column show-overflow-tooltip :prop="'wplisttype'" :label="$t('entities.emwplist.main2_grid.columns.wplisttype')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.wplisttype')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.wplisttype" tag='EMWPLISTTYPE' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemid')">
                <el-table-column show-overflow-tooltip :prop="'itemid'" :label="$t('entities.emwplist.main2_grid.columns.itemid')" :width="25"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.itemid')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.itemid}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('qcnt')">
                <el-table-column show-overflow-tooltip :prop="'qcnt'" :label="$t('entities.emwplist.main2_grid.columns.qcnt')" :width="25"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.qcnt')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.qcnt}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('need3q')">
                <el-table-column show-overflow-tooltip :prop="'need3q'" :label="$t('entities.emwplist.main2_grid.columns.need3q')" :width="25"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emwplist.main2_grid.columns.need3q')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.need3q" tag='YesNo' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class='grid-pagination' v-show="items.length > 0">
            <page class='pull-right' @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>